Skip to content

feat(scorer): calibrate freshness signal for mature packages#39

Merged
saraeloop merged 1 commit into
mainfrom
feat/scorer-signal-calibration
Apr 7, 2026
Merged

feat(scorer): calibrate freshness signal for mature packages#39
saraeloop merged 1 commit into
mainfrom
feat/scorer-signal-calibration

Conversation

@saraeloop
Copy link
Copy Markdown
Member

Summary

Calibrates the freshness-related signal to reduce false positives for newly published versions of mature packages.

Changes

Updated

  • src/adapters/heuristic-risk-scorer.ts
  • test/heuristic-risk-scorer.test.ts

Behavior

  • Adds a lower-weight signal for fresh releases of mature packages
  • Applies a maturity gate based on version history and download volume
  • Preserves existing behavior for packages without sufficient metadata
  • Leaves all other scoring logic unchanged

Verification

  • pnpm test
  • pnpm run build

- introduce lower-weight `fresh_release_on_mature_package` signal
- apply mature-package gate:
  - total_versions >= 100
  - weekly_downloads >= 100000
- replace high-weight `new_package_age` with lower-weight variant when gate is satisfied
- preserve existing behavior when weekly_downloads is null
- keep all other scoring logic unchanged

- add regression tests for:
  - mature high-download, high-version-history packages
  - genuinely new packages
  - null weekly_downloads fallback

verification:
- pnpm test
- pnpm run build
@saraeloop saraeloop self-assigned this Apr 7, 2026
@saraeloop saraeloop merged commit 78364d5 into main Apr 7, 2026
1 check passed
@saraeloop saraeloop deleted the feat/scorer-signal-calibration branch April 7, 2026 19:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant